/**
 *  Copyright 2013 University Pierre & Marie Curie - UMR CNRS 7606 (LIP6/MoVe)
 *  All rights reserved.   This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Initial contributor:
 *    Jean-Luc Amitousa - Thanh Cong - <jeanluc.amitousa.mankoy@gmail.com>
 *
 *  Mailing list:
 *    lom-messan.hillah@lip6.fr
 */
package sdmakerz_v1.coresyntax.menu;

import interfacegen.java.menu.InterfacesSettingsFrame;

import javax.swing.JFrame;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;

public class SDMakerV1Action 
implements IWorkbenchWindowActionDelegate{
		private static final String GENERAL_SETTINGS_ID= 
				"sdmakerz_v1.coresyntax.menu.SDMakerV1GeneralSettingsAction";

		private static final String INTERFACES_SETTINGS_ID=
				"javaInterfaceGen.menu.InterfacesAction";

		public void dispose() { }

		public void init(IWorkbenchWindow arg0) { }

		public void run(IAction action) {
			String actionID= action.getId();
			JFrame frame= null;

			System.out.println(actionID);
			
			if(actionID.compareTo(GENERAL_SETTINGS_ID)==0){
				frame= new SDMakerV1GeneralSettingsFrame();
				frame.setVisible(true);
			}
			else if(actionID.compareTo(INTERFACES_SETTINGS_ID)==0){
				frame= new InterfacesSettingsFrame();
				frame.setVisible(true);
			}
		}

		public void selectionChanged(IAction arg0, ISelection arg1) {}
}
